package n03;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class N02 {
	//在方法上通过throws声明来处理异常，把异常交给调用者来处理
	public static void main(String[] args) throws IOException {
		Path p1=Paths.get("C:/1/tmp2.txt");
      	Path p2=Paths.get("C:/1/tmp.txt");
      	Files.move(p1, p2);
      	System.out.println("改名成功~");

	}
}
